
'use strict';

angular.module('myApp.salary_old', [])

.controller('salary_oldCtrl', ['$scope','$http', 
    function($scope,$http) {

    var year = {'month' : $('#month').val()};
    $http.post('v1/salary/search',year).success(function(data){
	    if( !data.error ){
	        $scope.salarys = data.message['data'];
	    }else{
	        alert(data.message);
	    }
    });

    $scope.history = function(){
		var year = {'month' : $('#month').val()};
		// console.log(year);

	    $http.post('v1/salary/search',year).success(function(data){
		    if( !data.error ){
		        $scope.salarys = data.message['data'];
		    }else{
		        alert(data.message);
		    }
	    });
	};
    $('.year').bootstrapMonthpicker();
}]);